﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XmlServer.ServiceContracts;
using XmlServer.ServiceImplementation;


namespace DBQueryOperator
{
    public class Query : IOperator
    {

        public const string SERVER_NAME = "DBQuery Operator";
        public const string SERVER_VERSION = "1.0";

        public string Name
        {
            get { return SERVER_NAME; }
        }

        public string Version
        {
            get { return SERVER_VERSION; }
        }

        public string FullName
        {
            get { return String.Format("{0}_{1}", SERVER_NAME, Version); }
        }

        public string Description
        {
            get { return "Run a query against a database"; }
        }

        public List<IFact> Facts
        {
            get { return null; }
        }

        public IResponse ProcessRequest(IRequest request)
        {

            var errorMsg = "I'll implement this operator later...running out of time!";

            Response response = new Response();
            response.Request = request;
            response.Facts = XmlServer.Helper.Utilities.CreateException(errorMsg);
            response.StopProcessing = System.Environment.TickCount;
            response.Success = false;
            return response;

        }


    }
}
